add gtk_selection_data_get_data_with_length API which can be bound
authorMatthias Clasen <mclasen@redhat.com>
Mon, 3 Jan 2011 17:11:41 +0000 (12:11 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 3 Jan 2011 17:13:30 +0000 (12:13 -0500)
* gtk_selection_data_get_data can't be bound because we need to know the length
  of data inorder to marshal it

https://bugzilla.gnome.org/show_bug.cgi?id=635299

docs/reference/gtk/gtk3-sections.txt
gtk/gtk.symbols
gtk/gtkselection.c
gtk/gtkselection.h

index 51d5f634e71c84630d3fe8c6678c7eb73c720446..37f7c281e4990eba2cf48c4a9e69149e02509f2c 100644 (file)
@@ -5824,6 +5824,7 @@ gtk_selection_data_targets_include_rich_text
 gtk_selection_data_get_selection
 gtk_selection_data_get_data
 gtk_selection_data_get_length
+gtk_selection_data_get_data_with_length
 gtk_selection_data_get_data_type
 gtk_selection_data_get_display
 gtk_selection_data_get_format
index 2dbb2fffdbadb1fb64e8bafb1e2d477470d86cdd..e5c5c75b9eb64cca096b66a5fc6aaa0d8533f1df 100644 (file)
@@ -2292,6 +2292,7 @@ gtk_selection_data_get_data_type
 gtk_selection_data_get_display
 gtk_selection_data_get_format
 gtk_selection_data_get_length
+gtk_selection_data_get_data_with_length
 gtk_selection_data_get_pixbuf
 gtk_selection_data_get_selection
 gtk_selection_data_get_target
index 5ee7b2541d924e75702b6d4b4d9952a2bbbeaba0..06aa14678aff1d826e855a27327ba50424da823a 100644 (file)
@@ -1222,6 +1222,29 @@ gtk_selection_data_get_length (const GtkSelectionData *selection_data)
   return selection_data->length;
 }
 
+/**
+ * gtk_selection_data_get_data_with_length:
+ * @selection_data: a pointer to a #GtkSelectionData structure
+ * @length: return location for length of the data segment
+ *
+ * Retrieves the raw data of the selection along with its length.
+ *
+ * Returns: (array length=length): the raw data of the selection
+ *
+ * Rename to: gtk_selection_data_get_data
+ * Since: 3.0
+ */
+const guchar*
+gtk_selection_data_get_data_with_length (const GtkSelectionData *selection_data,
+                                         gint                   *length)
+{
+  g_return_val_if_fail (selection_data != NULL, NULL);
+
+  *length = selection_data->length;
+
+  return selection_data->data;
+}
+
 /**
  * gtk_selection_data_get_display:
  * @selection_data: a pointer to a #GtkSelectionData structure.
index 761d2b288a490cd1fae8059664b5b583c4068f6c..6b409bb8a08f1b38d3f510ca34b8561a23456a4a 100644 (file)
@@ -133,6 +133,10 @@ GdkAtom       gtk_selection_data_get_data_type (const GtkSelectionData *selectio
 gint          gtk_selection_data_get_format    (const GtkSelectionData *selection_data);
 const guchar *gtk_selection_data_get_data      (const GtkSelectionData *selection_data);
 gint          gtk_selection_data_get_length    (const GtkSelectionData *selection_data);
+const guchar *gtk_selection_data_get_data_with_length
+                                               (const GtkSelectionData *selection_data,
+                                                gint                   *length);
+
 GdkDisplay   *gtk_selection_data_get_display   (const GtkSelectionData *selection_data);
 
 void     gtk_selection_data_set      (GtkSelectionData     *selection_data,